﻿namespace MicroCloud.Log4Net
{
    /// <summary>
    /// 日志模块(Log4Net)
    /// </summary>
    [Description("日志模块(Log4Net)")]
    public class Log4NetPack : PackBase
    {
        #region 属性
        /// <summary>
        /// 获取 模块级别，级别越小越先启动
        /// </summary>
        public override PackLevel Level => PackLevel.Framework;
        
        /// <summary>
        /// 获取 模块启动顺序编号，模块启动的顺序先按级别启动，级别内部再按此顺序启动，
        /// 级别默认为0，表示无依赖，需要在同级别有依赖顺序的时候，再重写为>0的顺序值
        /// </summary>
        public override int OrderNo => 0;

        #endregion

        #region 方法
        /// <summary>
        /// 将模块服务添加到依赖注入服务容器中
        /// </summary>
        /// <param name="services">依赖注入服务容器</param>
        /// <returns></returns>
        public override IServiceCollection AddServices(IServiceCollection services)
        {
            services.AddSingleton<ILoggerProvider, Log4NetLoggerProvider>();
            return services;
        }

        #endregion

    }

}
